#include <iterator>

template<class OutputIterator> 
class CrypterOutputIterator : public std::iterator<std::output_iterator_tag, std::ptrdiff_t, char*, char&>
{
	public:
	
		CrypterOutputIterator(OutputIterator output) :
			m_output(output)
		{}

		CrypterOutputIterator& operator=(char c)
		{
			m_output = this->crypt(c);
			return *this;
		}
	
		CrypterOutputIterator& operator++()
		{
			++m_output;
			return *this;
		}

		CrypterOutputIterator operator++(int)
		{
			m_output++;
			return *this;
		}

		CrypterOutputIterator& operator*()
		{
			return *this;
		}

		char crypt(const char &c) 
		{
			return c + 15;
		}

		char decrypt(const char &c) 
		{
			return c - 15;
		}

	private:
	
		OutputIterator m_output;
};

